<?php

namespace app\api\validate;

use app\common\validate\CommonValidate;

class ArticleValidate
{
    public static function getArticleList($data)
    {
        $rule = array_merge([
            'category_id' => 'require',
            'sort_type' => 'require',
            //其他规则
        ], CommonValidate::$pageRule);
        $message = array_merge([
            'category_id.require' => "请选择分类",
            'sort_type.require' => "排序方式错误",
            //其他规则
        ], CommonValidate::$pageMsg);
        return CommonValidate::check($rule, $message, $data);
    }

    public static function getArticleInfo($data)
    {
        $rule = [
            'article_id' => 'require',
        ];
        $message = [
            'article_id.require' => "参数错误",
        ];
        return CommonValidate::check($rule, $message, $data);
    }
}